VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Open\Close The CD-Rom And Run Computer Settings and some files

by Saeed J.Ghanim (5 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 31st December 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Open\Close The CD-Rom And Run Computer Settings and some files

API Declarations


Cmd No.1 For Open the CD-Rom
Cmd No.2 For Close The Cd-Rom
Cmd No.3 For Run The control Panel
Cmd No.4 For Run the MSDOS
Cmd No.5 For Run The Win Calculator
Cmd No.6 For Run the WordPad
'Declare:
Private Declare Function MCISendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrcommand As String, ByVal lpstrReturnString As String, ByVal ureturnlength As Long, ByVal hwndcallBack As Long) As Long


Rate Open\Close The CD-Rom And Run Computer Settings and some files



On Error Resume Next
Dim Ret As Long
Dim RetStr As String
Select Case Index
Case Is = 0: Ret = MCISendString("Set CDAudio Door Open", RetStr, 127, 0)
Case Is = 1: Ret = MCISendString("Set CDAudio Door CLosed", RetStr, 127, 0)
End Select
End Sub

Private Sub Command2_Click()
Dim Ret As Long
Dim RetStr As String
Select Case Index
Case Is = 0: Ret = MCISendString("Set CDAudio Door Closed", RetStr, 127, 0)
Case Is = 1: Ret = MCISendString("Set CDAudio Door Open", RetStr, 127, 0)
End Select

End Sub




Private Sub Command3_Click()
Shell "control", vbNormalFocus
End Sub

Private Sub Command4_Click()
Shell "system32\cmd.exe", vbNormalFocus
End Sub

Private Sub Command5_Click()
Shell "C:\WINDOWS\system32\calc.exe", vbNormalFocus
End Sub

Private Sub Command6_Click()
Shell "C:\Program Files\Windows NT\Accessories\wordpad.exe", vbNormalFocus
End Sub



Download this snippet    Add to My Saved Code

Open\Close The CD-Rom And Run Computer Settings and some files Comments

No comments have been posted about Open\Close The CD-Rom And Run Computer Settings and some files. Why not be the first to post a comment about Open\Close The CD-Rom And Run Computer Settings and some files.

Post your comment

Subject:
Message:
0/1000 characters